<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js"></script>
	</head>
	<body>
		<div id="app">
			
		</div>
		<script>
			const notFound={template:'<p>PAGE NOT FOUND</p>'}
			const Home={template:'<p>Home page</p>'}
			const About={template:'<p>about page</p>'}
			const routes={
				'/':Home,
				'about':About
			}
			var app = new Vue({
				el:"#app",
				data:{currentRoute:window.location.pathname},
				computed:{
					ViewComponent(){return routes[this.currentRoute]||notFound}
				},
				render(h){
					return h(this.ViewComponent)
				}
			})
		</script>
	</body>
</html>
